package com.shbt.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * TResource entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_resource", catalog = "default_schema")
public class TResource implements java.io.Serializable {

	// Fields

	private Integer id;
	private TAuthorization TAuthorization;
	private String resourceCode;
	private String resourceName;

	// Constructors

	/** default constructor */
	public TResource() {
	}

	/** minimal constructor */
	public TResource(Integer id, TAuthorization TAuthorization) {
		this.id = id;
		this.TAuthorization = TAuthorization;
	}

	/** full constructor */
	public TResource(Integer id, TAuthorization TAuthorization,
			String resourceCode, String resourceName) {
		this.id = id;
		this.TAuthorization = TAuthorization;
		this.resourceCode = resourceCode;
		this.resourceName = resourceName;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_authorization_id", nullable = false)
	public TAuthorization getTAuthorization() {
		return this.TAuthorization;
	}

	public void setTAuthorization(TAuthorization TAuthorization) {
		this.TAuthorization = TAuthorization;
	}

	@Column(name = "resource_code", length = 20)
	public String getResourceCode() {
		return this.resourceCode;
	}

	public void setResourceCode(String resourceCode) {
		this.resourceCode = resourceCode;
	}

	@Column(name = "resource_name", length = 100)
	public String getResourceName() {
		return this.resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}

}